﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"  CodeFile="WebUserEdit.aspx.cs" Inherits="WebUserEdit" Title="WebUser Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" Runat="Server">Web User - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentContent" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="UserId" runat="server" DataSourceID="WebUserDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/WebUserFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/WebUserFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>WebUser not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:WebUserDataSource ID="WebUserDataSource" runat="server"
			SelectMethod="GetByUserId"
		>
			<Parameters>
				<asp:QueryStringParameter Name="UserId" QueryStringField="UserId" Type="String" />

			</Parameters>
		</data:WebUserDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewAfi1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewAfi1_SelectedIndexChanged"			 			 
			DataSourceID="AfiDataSource1"
			DataKeyNames="AfiCode"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Afi.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="ClientName" HeaderText="Client Name" SortExpression="[ClientName]" />				
				<asp:BoundField DataField="ClientAddress1" HeaderText="Client Address1" SortExpression="[ClientAddress1]" />				
				<asp:BoundField DataField="ClientAddress2" HeaderText="Client Address2" SortExpression="[ClientAddress2]" />				
				<asp:BoundField DataField="ClientAddress3" HeaderText="Client Address3" SortExpression="[ClientAddress3]" />				
				<asp:BoundField DataField="ClientTaxCode" HeaderText="Client Tax Code" SortExpression="[ClientTaxCode]" />				
				<data:HyperLinkField HeaderText="Created By" DataNavigateUrlFormatString="WebUserEdit.aspx?UserId={0}" DataNavigateUrlFields="UserId" DataContainer="CreatedBySource" DataTextField="Name" />
				<asp:BoundField DataField="CreatedDate" HeaderText="Created Date" SortExpression="[CreatedDate]" />				
				<asp:BoundField DataField="Currency" HeaderText="Currency" SortExpression="[Currency]" />				
				<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="[Status]" />				
				<asp:BoundField DataField="Pam" HeaderText="Pam" SortExpression="[PAM]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Afi Found! </b>
				<asp:HyperLink runat="server" ID="hypAfi" NavigateUrl="~/admin/AfiEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:AfiDataSource ID="AfiDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:AfiProperty Name="WebUser"/> 
					<%--<data:AfiProperty Name="AttachmentCollection" />--%>
					<%--<data:AfiProperty Name="AfiDetailCollection" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:AfiFilter  Column="CreatedBy" QueryStringField="UserId" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:AfiDataSource>		
		
		<br />
		

</asp:Content>

